package com.fyzk.view;

import android.content.Context;
import android.text.Html;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.fyzk.constants.ConstantsDJ;
import com.fyzk.data.AppLotteryInfos;
import com.tyjc.lottery.R;

public class ShaidanItemView extends LinearLayout {

	private TextView lotteryName;// 彩种名称
	private TextView ticheng;// 方案提成
	private TextView shaiDanAmount;// 晒单彩金
	private TextView genNum;// 跟单人数
	private TextView shaidanRen;// 晒单人
	private TextView zhanji;// 战绩
	private TextView baomi;// 保密设置
	private TextView gendanbeishu;
	
	private Context context;

	public ShaidanItemView(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
		init(context);
	}

	private void init(Context context) {
		this.context = context;
		// TODO Auto-generated method stub
		View.inflate(context, R.layout.layout_shaidan_item, this);
		lotteryName = (TextView) findViewById(R.id.shaidan_lotteryName);
		ticheng = (TextView) findViewById(R.id.shaidan_ticheng);
		shaiDanAmount = (TextView) findViewById(R.id.shaidan_danzhujine);
		shaidanRen = (TextView) findViewById(R.id.shaidan_faqiren);
		gendanbeishu = (TextView) findViewById(R.id.shaidan_gendanbeishu);
	}

	/**
	 * 设置晒单人
	 * 
	 * @param shaidanren
	 *            晒单人
	 */
	public void setShaidanRen(String shaidanren) {
		String show = "发起:" + "<font color = \"blue\">" + shaidanren + "</font>";
		shaidanRen.setText(Html.fromHtml(show));
	}

	/**
	 * 设置晒单彩金
	 * 
	 * @param amount
	 *            晒单彩金
	 */
	public void setShaidanAmount(String amount) {
		String show = "单注:" + "<font color = \"red\">" + amount + "米" + "</font>";

		shaiDanAmount.setText(Html.fromHtml(show));
	}

	/**
	 * 设置方案提成
	 * 
	 * @param tichengstr
	 *            提成
	 */
	public void setTiCheng(String tichengstr) {
		String show = "提成:" + "<font color = \"red\">" + tichengstr + "%" + "</font>";

		ticheng.setText(Html.fromHtml(show));
	}

	/**
	 * 设置彩种名称
	 * 
	 * @param lotteryid
	 */
	public void setLotteryName(String lotteryid) {
		String lotteryname = AppLotteryInfos.getLotteryName(lotteryid)+"  "+ConstantsDJ.wcode(lotteryid);
		lotteryName.setText(lotteryname);
	}

	/**
	 * 设置跟单倍数
	 * 
	 * @param beishu
	 *            跟单倍数
	 */
	public void setBeishu(String beishu) {

		gendanbeishu.setText("跟单倍数："+beishu);
	}

}
